import http from '@/common/js/httpRequest'
//获取角色列表
export function getRoleList (params) {
  return http({
    method: 'get',
    url: '/api/sys/role/list',
    params
  })
}
//配置菜单
export function updateRolecollocate (data) {
  return http({
    method: 'post',
    url: '/api/sys/role/collocate',
    data
  })
}
//新增或修改角色
export function saveOrUpdateRole (data) {
	const url = !data.roleId ? '/api/sys/role/save' : '/api/sys/role/update'
  return http({
    method: 'post',
    url: url,
    data
  })
}
//删除角色
export function deleteRole (ids) {
  return http({
    method: 'post',
    url: '/api/sys/role/delete',
    data: ids,
    openDefultdata: true
  })
}
//获取角色列表
export function getTypeIdListByRoleId (id) {
  return http({
    method: 'get',
    url: `/api/sys/role/types?roleId=${id}`
  })
}